package com.example.administrator.chinafood.SQLite;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by Administrator on 2017/11/15.
 */

public class MyDBOpenHelper extends SQLiteOpenHelper{

    public MyDBOpenHelper(Context context, String name){
        super(context,name,null,1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table user (personid integer primary key autoincrement,username varchar(20),password varchar(30))");
        db.execSQL("create table forum (personid integer primary key autoincrement ,title varchar(30),author varchar(30)," +
                "time varchar(30),content varchar(200),img integer,num varchar(4))");
        db.execSQL("create table liuyan (personid integer ,user varchar(30)," +
                "time varchar(30),content varchar(200),img integer)");
        db.execSQL("create table myliuyan (user varchar(30),personid integer)");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
